const path = require("path");
const { override, adjustStyleLoaders, addWebpackAlias, addLessLoader }  = require("customize-cra");

 module.exports = override(
    adjustStyleLoaders(rule => {
        if (rule.test.toString().includes('scss')) {
            rule.use.push({
                loader: require.resolve('sass-resources-loader'),
                options: {
                    resources: [
                        './src/assets/styles/reset.scss',
                        './src/assets/styles/theme.scss',
                        './src/assets/styles/mixins.scss',
                    ]
                }
            });
        }
    }),
    addLessLoader(),
    addWebpackAlias({
        "@": path.resolve(__dirname, 'src')
    })
);